package com.easygo.client;

import com.easygo.common.PageUtils;
import com.easygo.common.ResultResponse;
import com.easygo.pojo.ContentCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("EASYGO-ADMIN-SERVER")
public interface ContentCategoryClient {

    @RequestMapping("contentCategory_page/{indexPage}/{pageSize}")
    public PageUtils<ContentCategory> getContentByPage(@PathVariable("indexPage")Long indexPage
            , @PathVariable("pageSize")Long pageSize
            , @RequestParam("name")String name);

    //后台的新增广告分类controller
    @RequestMapping("contentCategory_add")
    public ResultResponse<ContentCategory> contentCategory_add(@RequestBody ContentCategory contentCategory);


    @PostMapping("/contentCategory_updateById")
    public ResultResponse contentCategory_updateById(@RequestBody ContentCategory contentCategory);


    @PostMapping("/contentCategory_deleteById/{id}")
    public ResultResponse contentCategory_deleteById(@PathVariable("id") Long id);


    @PostMapping("/contentCategory_list")
    public List<ContentCategory> getcontentCategorys();

    @GetMapping("/getById/{id}")
    public ContentCategory getById(@PathVariable("id") long id);

    @GetMapping("/isHasChild/{contentCategoryId}")
    public Integer isHasChild(@PathVariable("contentCategoryId") long contentCategoryId);
}
